exports.__esModule = true;

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }

exports.default = class extends think.BaseController {

    queryTaskByProcIdAction() {
        var _this = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            let getData = {
                proc_inst_id: _this.get('id')
            };
            const TaskService = _this.service('bpmn/TaskService');
            let res = yield TaskService.getTaskByProcId(getData);
            let act = yield TaskService.getWaitAssigneeByProcId(getData);
            for (let i of act) {
                i.dataValues.task_status = i.act_status;
                i.dataValues.name = i.act_name;
                res.push(i);
            }
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '查询失败';
            }
            return _this.json(aj);
        })();
    }
};